#ifndef HEADER_IDEA_H
#define HEADER_IDEA_H

/*
	idea 是一种对称分组加密算法
	秘钥长度128bit， 单轮分组64bit

	#define IDEA_BLOCK	8
	#define IDEA_KEY_LENGTH	16

	代码来自： https://gitee.com/jason_wang119/idea
*/

#ifdef  __cplusplus
extern "C" {
#endif


#define IDEA_INT unsigned int
#define uint8_t unsigned char
#define uint16_t unsigned short
#define uint32_t unsigned long

typedef struct idea_key_st
{
	uint32_t data[9][6];
} IDEA_KEY_SCHEDULE;

char *idea_options(void);
void idea_ecb_encrypt(uint8_t *in, uint8_t *out, IDEA_KEY_SCHEDULE *ks);
void idea_set_encrypt_key(uint8_t *key, IDEA_KEY_SCHEDULE *ks);
void idea_set_decrypt_key(IDEA_KEY_SCHEDULE *ek, IDEA_KEY_SCHEDULE *dk);
void idea_encrypt(uint32_t *in, IDEA_KEY_SCHEDULE *ks);

#ifdef  __cplusplus
}
#endif

#endif
